package com.dingwei.lesyndrome.adapter;

import android.content.Context;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.dingwei.lesyndrome.R;
import com.dingwei.lesyndrome.bean.CheckBean;
import com.dingwei.lesyndrome.bean.MyNewsBean;
import com.jude.easyrecyclerview.adapter.BaseViewHolder;
import com.jude.easyrecyclerview.adapter.RecyclerArrayAdapter;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * Created time 2018/3/6.
 * Creator 南柯一梦丶 on
 * Personal signature 余生还长 何必慌张
 * Page description :
 */

public class ReportAdapter extends RecyclerArrayAdapter<CheckBean> {
    public ReportAdapter(Context context) {
        super(context);
    }

    @Override
    public BaseViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) {
        return new ReportHolder(parent);
    }

    public class ReportHolder extends BaseViewHolder<CheckBean> {


        @Bind(R.id.img)
        ImageView img;
        @Bind(R.id.tv_name)
        TextView tvName;
        @Bind(R.id.ll_root)
        LinearLayout llRoot;

        public ReportHolder(ViewGroup parent) {
            super(parent, R.layout.item_report);
            ButterKnife.bind(this, itemView);


        }

        @Override
        public void setData(CheckBean data) {
            super.setData(data);
            tvName.setText(data.name);
            if (data.isCheck){
                img.setImageResource(R.drawable.pic67);
            }else {
                img.setImageResource(R.drawable.pic68);
            }

        }
    }
}
